import {createStore,combineReducers, applyMiddleware} from "redux"
import HomeReducer from"./reducer/HomeReducer"
import catetryReducer from"./reducer/catetryReducer"
import searchReducer from "./reducer/searchReducer"
import reduxThunk from "redux-thunk"
let reducer =combineReducers({
    HOME:HomeReducer,
    CATETRY:catetryReducer,
    SEARCH:searchReducer
})
export default createStore(reducer,applyMiddleware(reduxThunk))

// combineReducers  合并所有的reducers,有多少合并多多少,必须是一个对象
// createStore 创建仓库，接收三个参数，第一个的reducer，第二个为可选参数，第三个为applyMiddleware用来扩展dispatch
// reduxthunk 中间件用于发送多次action请求